package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhFactoryBalanceDetailsMapper;
import com.ruoyi.zsyh.domain.ZsyhFactoryBalanceDetails;
import com.ruoyi.zsyh.service.IZsyhFactoryBalanceDetailsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 厂家余额变动明细Service业务层处理
 * 
 * @author yuexl
 * @date 2022-01-04
 */
@Service
public class ZsyhFactoryBalanceDetailsServiceImpl implements IZsyhFactoryBalanceDetailsService 
{
    @Autowired
    private ZsyhFactoryBalanceDetailsMapper zsyhFactoryBalanceDetailsMapper;

    /**
     * 查询厂家余额变动明细
     * 
     * @param id 厂家余额变动明细ID
     * @return 厂家余额变动明细
     */
    @Override
    public ZsyhFactoryBalanceDetails selectZsyhFactoryBalanceDetailsById(Long id)
    {
        return zsyhFactoryBalanceDetailsMapper.selectZsyhFactoryBalanceDetailsById(id);
    }

    /**
     * 查询厂家余额变动明细列表
     * 
     * @param zsyhFactoryBalanceDetails 厂家余额变动明细
     * @return 厂家余额变动明细
     */
    @Override
    public List<ZsyhFactoryBalanceDetails> selectZsyhFactoryBalanceDetailsList(ZsyhFactoryBalanceDetails zsyhFactoryBalanceDetails)
    {
        return zsyhFactoryBalanceDetailsMapper.selectZsyhFactoryBalanceDetailsList(zsyhFactoryBalanceDetails);
    }

    /**
     * 新增厂家余额变动明细
     * 
     * @param zsyhFactoryBalanceDetails 厂家余额变动明细
     * @return 结果
     */
    @Override
    public int insertZsyhFactoryBalanceDetails(ZsyhFactoryBalanceDetails zsyhFactoryBalanceDetails)
    {
        zsyhFactoryBalanceDetails.setCreateTime(DateUtils.getNowDate());
        return zsyhFactoryBalanceDetailsMapper.insertZsyhFactoryBalanceDetails(zsyhFactoryBalanceDetails);
    }

    /**
     * 修改厂家余额变动明细
     * 
     * @param zsyhFactoryBalanceDetails 厂家余额变动明细
     * @return 结果
     */
    @Override
    public int updateZsyhFactoryBalanceDetails(ZsyhFactoryBalanceDetails zsyhFactoryBalanceDetails)
    {
        return zsyhFactoryBalanceDetailsMapper.updateZsyhFactoryBalanceDetails(zsyhFactoryBalanceDetails);
    }

    /**
     * 删除厂家余额变动明细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhFactoryBalanceDetailsByIds(String ids)
    {
        return zsyhFactoryBalanceDetailsMapper.deleteZsyhFactoryBalanceDetailsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除厂家余额变动明细信息
     * 
     * @param id 厂家余额变动明细ID
     * @return 结果
     */
    @Override
    public int deleteZsyhFactoryBalanceDetailsById(Long id)
    {
        return zsyhFactoryBalanceDetailsMapper.deleteZsyhFactoryBalanceDetailsById(id);
    }
}
